package com.qf.service.impl;

import com.qf.mapper.GoodsMapper;
import com.qf.pojo.Goods;
import com.qf.pojo.PageBean;
import com.qf.service.GoodsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Resource
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> selectSome(Integer c1, Integer c2, Integer c3, String words, PageBean pb) {
        return goodsMapper.listSome(c1,c2,c3,words,(pb.getNowPage()-1)*pb.getRowsPerPage(),pb.getRowsPerPage());
    }

    @Override
    public int getAllRows(Integer c1, Integer c2, Integer c3, String words) {
        return goodsMapper.getRows(c1,c2,c3,words);
    }


    @Override
    public Goods getDetailById(Integer gid) {
        return goodsMapper.selectOne(gid);
    }
}
